﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width" />
    <title>生产管理粗纱机</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet" />
    <script src="../Content/scripts/jquery-1.11.1.min.js"></script>
    <link href="../Content/styles/font-awesome.min.css" rel="stylesheet" />
    <link href="../Content/scripts/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/jquery-ui/jquery-ui.min.js"></script>
    <link href="../Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="../Content/scripts/bootstrap/bootstrap.min.js"></script>
    <link href="../Content/scripts/plugins/jqgrid/jqgrid.css" rel="stylesheet" />
    <link href="../Content/adminLTE/css/index.css" rel="stylesheet" />
    <link href="../Content/styles/learun-ui.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../Content/scripts/plugins/jqgrid/jqgrid.min.js"></script>
    <script src="../Content/scripts/plugins/tree/tree.js"></script>
    <script src="../Content/scripts/plugins/validator/validator.js"></script>
    <script src="../Content/scripts/plugins/dialog/dialog.js"></script>
    <script src="../Content/scripts/utils/learun-ui.js"></script>
    <script src="../Content/scripts/utils/learun-form.js"></script>
    <link href="../Content/scripts/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
    <script src="../Content/scripts/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="../Content/scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../Content/scripts/plugins/layout/jquery.layout.js"></script>
    <script src="../My97DatePicker/WdatePicker.js"></script>
    <script src="../js/highcharts.js"></script>
    <script src="../js/highcharts-3d.js"></script>
    <script src="../js/getUrlParam.js"></script>
    <script src="MFGjs.js"></script>
    <script src="CushaJS.js"></script>


    <style type="text/css">
        body {
            margin: 0px;
            margin-top: 10px;
        }

        .form .formTitle {
            width: 150px;
            font-size: 20px;
            padding-bottom: 35px;
        }

        .form .formValue {
            padding-bottom: 25px;
            width: 150px;
        }

        .valuestyle {
            font-size: 20px;
        }

        #title {
            font-size: 30px;
            text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
        }

        #time {
            font-size: 20px;
            float: right;
            line-height: 50px;
            right: 40px;
            position: fixed;
            color: #65b540;
        }

        @media screen and (min-width:1281px) and (max-width:1440px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        @media screen and (max-width:1024px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }



        @media screen and (min-width:1025px) and (max-width:1280px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        #info {
            float: right;
            color: #ff0000;
            font-size: 9px;
        }

        a {
            color: skyblue;
            text-decoration: none;
            cursor: pointer;
        }

        span {
            border-radius: 100px;
        }

        .highcharts-subtitle {
            left: 260px;
        }

            .highcharts-subtitle a {
                font-size: 20px;
            }
    </style>
</head>

<body>
    <div id="ajax-loader" style="cursor: progress; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: #fff; z-index: 10000; overflow: hidden;">
        <img src="../Content/images/ajax-loader.gif" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;" />
    </div>

    <div style="text-align: center; height: 50px;">
        <span id="title">生产信息</span>
        <span id="time"></span>
    </div>
    <ul id="myTab" class="nav nav-tabs">
        <li class="active">
            <a href="#home" data-toggle="tab">
                基本信息
            </a>
        </li>
        <li class="dropdown">
            <a href="#" id="myTabDrop" class="dropdown-toggle"
               data-toggle="dropdown">
                粗纱监视 <b class="caret"></b>
            </a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop">
                <li>
                    <a href="#shishijilu" tabindex="-1" data-toggle="tab">
                        实时数据
                    </a>
                </li>
                <li>
                    <a href="#dantaijianshi" tabindex="-1" data-toggle="tab">
                        单台监视
                    </a>
                </li>
                <li>
                    <a href="#kaitingche" tabindex="-1" data-toggle="tab">
                        当日停车占比
                    </a>
                </li>
                <li>
                    <a href="#shishitongjitu" tabindex="-1" data-toggle="tab">
                        实时统计信息图
                    </a>
                </li>
                <li>
                    <a href="#lishitongji" tabindex="-1" data-toggle="tab">
                        历史统计
                    </a>
                </li>
            </ul>
        </li>
        <li>
            <a href="#weisha" data-toggle="tab">尾纱监视</a>
        </li>
        <li class="dropdown">

        </li>
    </ul>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade in active" id="home">
            <div class="ui-layout" id="layout" style="width:100%;">
                <div class="ui-layout-west" id="westpanel">
                    <div class="west-Panel">
                        <div class="panel-Title">车间布局图</div>
                        <img src="" id="chejianimg" />
                    </div>
                </div>

                <div class="ui-layout-center" id="centerpanel">
                    <div class="center-Panel">
                        <div class="panel-Title">目标产量完成产量</div>
                        <table class="form" id="mubiaochanlianform" style="margin-top: 50px;"></table>
                    </div>
                </div>
            </div>
        </div>

        <!--粗纱实时数据-->
        <div class="tab-pane fade" id="shishijilu">
            <div class="panel-Title">
                粗纱实时数据

            </div>
            <table id="tb_cusha"></table>
            <div class="panel-group" id="accordion" style="margin-top: 20px;">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse" data-parent="#accordion"
                               href="#collapseexample">
                                历史改动记录
                            </a>
                        </h4>
                    </div>
                    <div id="collapseexample" class="panel-collapse collapse">
                        <div class="panel-body">
                            <table id="tb_lishigaidong"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--粗纱单台数据-->
        <div class="tab-pane fade" id="dantaijianshi">
            <div class="panel-Title">
                粗纱单台监视
            </div>
            <div class="titlePanel">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>选择粗纱台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="equnolist" style="width: 100px;"></select>
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <!--<div class="panel-Title" id="dantaijianshiwesttitle">单台粗纱实时数据--</div>-->
            <table id="dantaijianshitable"></table>

            <div class="panel-Title" id="dantaijianshicentertitle">粗纱报警信息--</div>
            <table id="gridTable"></table>
        </div>

        <!--开停车记录-->
        <div class="tab-pane fade" id="kaitingche">
            <div class="panel-Title">
                当日停车占比
            </div>
            <div class="titlePanel" style="border-bottom: 1px solid #ccc;">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>机台选择：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="equnolist2" style="width: 100px;"></select>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div style="width: 100%; float:left; margin-top: 50px; ">
                <div id="kaitingchecontainerA" style="width: 33%; float:left; height: 400px; margin: 2px;">
                </div>
                <div id="kaitingchecontainerB" style="width: 33%; float:left; height: 400px; margin: 2px;">
                </div>
                <div id="kaitingchecontainerC" style="width: 33%; float:left; height: 400px; margin: 2px;">
                </div>
            </div>
        </div>

        <!--实时统计信息图-->
        <div class="tab-pane fade" id="shishitongjitu">
            <div class="panel-Title">
                粗纱单台实时统计信息图
            </div>
            <div class="titlePanel" style="border-bottom: 1px solid #ccc;">
                <div class="title-search">
                    <table>
                        <tr>
                            <td style="padding-left: 5px;">
                                <span>选择粗纱台号：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="equnolist1" style="width: 100px;"></select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>参数类型：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="parmlist" style="width: 200px;">
                                    <option value="1" selected>锭翼电机速度</option>
                                    <option value="2">筒管电机速度</option>
                                    <option value="3">罗拉电机速度</option>
                                    <option value="4">升降电机速度</option>
                                    <option value="5">锭翼电机温度</option>
                                    <option value="6">筒管电机温度</option>
                                    <option value="7">罗拉电机温度</option>
                                    <option value="8">升降电机温度</option>
                                    <option value="9">龙筋位置</option>
                                    <option value="10">电流</option>
                                    <option value="11">电压</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="width: 100%; float:left; margin-top: 50px; ">
                    <div id="shishitongjitucontainer" style="width: 100%; margin: 0 auto; height: 600px;">

                    </div>
                </div>

            </div>
        </div>

        <!--历史统计-->
        <div class="tab-pane fade" id="lishitongji">
            <div class="panel-Title">
                历史记录统计
            </div>
            <div class="titlePanel">
                <div class="title-search">
                    <table>
                        <tr>

                            <td style="padding-left: 5px;">
                                <span>选择班次：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <select class="form-control" id="banci" style="width: 100px;">
                                    <option value="0">不限</option>
                                    <option value="1">早班</option>
                                    <option value="2">中班</option>
                                    <option value="3">晚班</option>
                                </select>
                            </td>
                            <td style="padding-left: 5px;">
                                <span>开始时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="StartTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({lang:'zh-cn',maxDate:'#F{$dp.$D(\'EndTime\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'})" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <span>结束时间：</span>
                            </td>
                            <td style="padding-left: 5px;">
                                <input id="EndTime" type="text" class="form-control input-datepicker" onclick="WdatePicker({ lang: 'zh-cn', minDate: '#F{$dp.$D(\'StartTime\')}', maxDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd' })" style="width: 150px;">
                            </td>
                            <td style="padding-left: 5px;">
                                <a id="btn_lishitongjiSearch" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <table id="gridTabletongji"></table>

        </div>
    </div>

    <div id="loading_background" class="loading_background" style="display: none;"></div>
    <div id="loading_manage" style="display: none;">
        正在拼了命为您加载…
    </div>
    <script>

        var IDs = UrlParam.paramValues("ID");
        var ID = IDs[0];
        var width = "";
        var height = "";
        var activeTab = "#home";
        $(function () {
        $.mfgjs.getCustomInfoByID(ID);
        $.Cushajs.initmubiaochanliang(ID);

        width = $(window).width();
        height = $(window).height();
        $("#layout").height(height - 120);
        $("#westpanel").height(height - 120);
        $("#centerpanel").height(height - 100);
        $("#mubiaochanlianform").height(height - 250);
        $("#chejianimg").height(height - 180);
        $("#ruleinfo").height(height - 180);
        $("#chejianimg").width(width - 450);

        //layout布局
        $('#layout').layout({
            applyDemoStyles: true,
            west: {
                size: $(window).width() - 400
            },
            onresize: function () {
                $(window).resize()
            }
        });

        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {

            // 获取已激活的标签页的名称
            activeTab = $(e.target).attr('href');

            if (activeTab == '#shishijilu') {
                //1.初始化Table
                var oTable = new TableInit();
                oTable.Init();

                //2.初始化Button的点击事件
                var oButtonInit = new ButtonInit();
                oButtonInit.Init();

                $.Cushajs.initlishigaidongjilutable();

            }
            //单台监视
            else if (activeTab == '#dantaijianshi') {
                //$("#dantaijianshilayout").height(height - 300);
                //$("#dantaijianshiwestpanel").height(height - 300);
                //$("#dantaijianshicenterpanel").height(height - 300);
                //$("#dantaijianshi").height(height - 300);
                //$("#gridTable").trigger('reloadGrid');
                $.Cushajs.getEquNolistByCustomerID(ID,1);
                //$.Cushajs.initdantaijianshiwestpanel();
                ////layout布局
                //$('#dantaijianshilayout').layout({
                //    applyDemoStyles: true,
                //    west: {
                //        size: $(window).width() * 0.58
                //    },
                //    onresize: function () {
                //        $(window).resize()
                //    }
                //});

                //$('#equnolist').on('change', function () {
                //    //判断是否选取prompt属性，无返回值；
                //    if ($(this).val()) {
                //        //$("#dantaijianshitable").html("");

                //        $("#gridTable").jqGrid("clearGridData");
                //        var selectText = $(this).find('option:selected').text();

                //        //$("#dantaijianshiwesttitle").html("单台粗纱实时数据--" + selectText);
                //        $("#dantaijianshicentertitle").html("粗纱报警信息--" + selectText);
                //        $.Cushajs.initdantaijianshitable($(this).find('option:selected').val(), selectText, $("#time").text());

                //        $('#gridTable').jqGrid('setGridParam', {
                //            postData: {
                //                Action: "initdantaicushabaojingtable",
                //                EquNo: $(this).find('option:selected').val(),
                //                TaiHao: selectText,
                //                Time: $("#time").text()
                //            },
                //        }).trigger('reloadGrid');
                //    }
                //});

                //查询事件
                $("#btn_Search").click(function () {
                    Loading(true);

                    $("#dantaijianshicentertitle").html("粗纱报警信息--" + $('#equnolist').find('option:selected').text());

                    //$.Cushajs.initdantaijianshitable($("#equnolist").find("option:selected").val(), $("#equnolist").find("option:selected").text(), $("#time").text());
                    $('#dantaijianshitable').jqGrid('setGridParam', {
                        postData: {
                            Action: "initdangtaijianshidata",
                            EquNo: $('#equnolist').find('option:selected').val(),
                            TaiHao: $('#equnolist').find('option:selected').text(),
                            Time: $("#time").text()
                        },
                    }).trigger('reloadGrid');

                    $('#gridTable').jqGrid('setGridParam', {
                        postData: {
                            Action: "initdantaicushabaojingtable",
                            EquNo: $('#equnolist').find('option:selected').val(),
                            TaiHao: $('#equnolist').find('option:selected').text(),
                            Time: $("#time").text()
                        },
                    }).trigger('reloadGrid');

                });
            }
            // 实时统计图
            else if (activeTab == '#shishitongjitu') {
                $.Cushajs.getEquNolistByCustomerID(ID, 2);
                $('#equnolist1').on('change', function () {
                    //判断是否选取prompt属性，无返回值；
                    if ($(this).val()) {
                        var selectText = $(this).find('option:selected').text();
                        var parmValue = $("#parmlist").find('option:selected').val();
                        var parmText = $("#parmlist").find('option:selected').text();
                        $.Cushajs.initshishitongjitu(selectText,parmValue,parmText);
                        //$.Cushajs.initdantaijianshiwestpanel(selectText);
                        //$.Cushajs.initdantaicushabaojingtable(selectText);
                    }
                });

                $('#parmlist').on('change', function () {
                    //判断是否选取prompt属性，无返回值；
                    if ($(this).val()) {
                        var selectText = $('#equnolist1').find('option:selected').text();
                        var parmValue = $("#parmlist").find('option:selected').val();
                        var parmText = $("#parmlist").find('option:selected').text();
                        $.Cushajs.initshishitongjitu(selectText, parmValue, parmText);
                        //$.Cushajs.initdantaijianshiwestpanel(selectText);
                        //$.Cushajs.initdantaicushabaojingtable(selectText);
                    }
                });
            }
            //停车占比
            else if (activeTab == '#kaitingche') {

                $.Cushajs.getEquNolistByCustomerID(ID, 3);
                $('#equnolist1').on('change', function () {
                    //判断是否选取prompt属性，无返回值；
                    if ($(this).val()) {
                        var selectText = $(this).find('option:selected').text();
                        var parmValue = $("#parmlist").find('option:selected').val();
                        var parmText = $("#parmlist").find('option:selected').text();
                        $.Cushajs.initshishitongjitu(selectText, parmValue, parmText);

                    }
                });
            }
             //历史统计
            else if (activeTab == '#lishitongji') {

                //查询事件
                $("#btn_lishitongjiSearch").click(function () {
                    var banci = $("#banci").val();
                    var StartTime = $("#StartTime").val();
                    var EndTime = $("#EndTime").val();

                    $.Cushajs.initlishitongjitable(ID,banci,StartTime,EndTime);
                    //$gridTable.jqGrid('setGridParam', {
                    //    postData: {
                    //        Action: "GetRoleInfo",
                    //        keyword: $("#txt_Keyword").val(),
                    //        CustomerName: getCookie("CustomerName")
                    //    },
                    //}).trigger('reloadGrid');

                });
            }

        });


    });


    var TableInit = function () {
        var oTableInit = new Object();
        var time = $("#time").text();
        //初始化Table
        oTableInit.Init = function () {
            $('#tb_cusha').bootstrapTable({
                url: '../MFG/MFGCusha.ashx?Action=getshishijilulist&time='+time,         //请求后台的URL（*）
                method: 'POST',                      //请求方式（*）
                contentType: "application/x-www-form-urlencoded",
                toolbar: '#toolbar',                //工具按钮用哪个容器
                striped: true,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                pagination: false,                   //是否显示分页（*）
                sortable: true,                     //是否启用排序
                sortOrder: "asc",                   //排序方式
                queryParams: oTableInit.queryParams, //参数
                //queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: true,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                strictSearch: true,
                showColumns: true,                  //是否显示所有的列
                showRefresh: true,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                //height: 600,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                uniqueId: "ID",                     //每一行的唯一标识，一般为主键列
                showToggle: true,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,                   //是否显示父子表
                rowStyle: function (row, index) {
                    //这里有5个取值代表5中颜色['active', 'success', 'info', 'warning', 'danger'];
                    var strclass = "";
                    if (row.zhuangtai == "1") {
                        strclass = 'success';//还有一个active
                    }
                    else if (row.zhuangtai == "2") {
                        strclass = 'warning';
                    }
                    else if (row.zhuangtai == "3") {
                        strclass = 'danger';
                    }
                    else {
                        return {};
                    }
                    return { classes: strclass }
                },
                columns: [{
                    field: 'EquNo',
                    title: '机台号',
                    sortable: true,
                    width: 100
                }, {
                    field: 'Kind',
                    title: '纺纱品种'
                }, {
                    field: 'dangqianbanci',
                    title: '当前班次',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return 'A班';
                        }
                        else if (value == 2) {
                            return 'B班';
                        }
                        else if (value == 3) {
                            return 'C班';
                        }
                    }
                }, {
                    field: 'Chanliangm',
                    title: '当班产量(m)'
                }, {
                    field: 'dangqianchangdu',
                    title: '当前纺纱长度'
                }, {
                    field: 'dangqianxiaolv',
                    title: '当前效率'
                },  {
                    field: 'tongguansudu',
                    title: '筒管速度'
                }, {
                    field: 'dingyisudu',
                    title: '锭翼速度'
                }, {
                    field: 'luolasudu',
                    title: '罗拉速度'
                }, {
                    field: 'shengjiangsudu',
                    title: '升降速度'
                },
                //{
                //    field: 'tongguanwendu',
                //    title: '筒管温度'
                //}, {
                //    field: 'dingyiwendu',
                //    title: '锭翼温度'
                //}, {
                //    field: 'luolawendu',
                //    title: '罗拉温度'
                //}, {
                //    field: 'shengjiangwendu',
                //    title: '升降温度'
                //},
                {
                    field: 'longjinweizhi',
                    title: '龙筋位置'
                }, {
                    field: 'zhuangtai',
                    title: '状态'
                    //formatter: function (value, row, index) {
                    //    //if (value == 1) {
                    //    //    return '<span class=\"label label-success\">开车</span>';
                    //    //}
                    //    //else if (value == 2) {
                    //    //    return '<span class=\"label label-warning\">落纱</span>';
                    //    //}
                    //    //else if (value == 3) {
                    //    //    return '<span class=\"label label-danger\">停车</span>';
                    //    //}
                    //}
                }]
            });
        };

        //得到查询的参数
        oTableInit.queryParams = function (params) {
            console.log(params);
            var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                CustomerID: ID,
                pageSize: params.limit, //页面大小
                offset: params.offset, //页码
                sort: params.sort, //排序列名
                sortOrder: params.order//排位命令（desc，asc）
            };
            console.log(temp);
            return temp;
        };
        return oTableInit;
    };


    var ButtonInit = function () {
        var oInit = new Object();
        var postdata = {};

        oInit.Init = function () {
            //初始化页面上面的按钮事件
        };

        return oInit;
    };

    setInterval(function () {
        fnDate();
    }, 1000);

    setInterval(function () {

        if (activeTab == '#shishijilu') {
             queryAll();
        }
        else if (activeTab == '#dantaijianshi') {

            var selectText = $('#equnolist').find('option:selected').text();
            //$.Cushajs.initdantaijianshitable($('#equnolist').find('option:selected').val(), selectText, $("#time").text());
            $("#gridTable").trigger('reloadGrid');
        }
        else if (activeTab == '#shishitongjitu') {
            var selectText = $('#equnolist1').find('option:selected').text();
            var parmValue = $("#parmlist").find('option:selected').val();
            var parmText = $("#parmlist").find('option:selected').text();
            $.Cushajs.initshishitongjitu(selectText, parmValue, parmText);
        }
        else if (activeTab == '#kaitingche') {
            //var selectText = $('#equnolist2').find('option:selected').text();
            //$.Cushajs.inittingcheApie(selectText);
            //$.Cushajs.inittingcheBpie(selectText);
            //$.Cushajs.inittingcheCpie(selectText);
        }
    }, 60000);




    //js 获取当前时间
    function fnDate() {
        var oDiv = document.getElementById("time");
        var date = new Date();
        var year = date.getFullYear();//当前年份
        var month = date.getMonth();//当前月份
        var data = date.getDate();//天
        var hours = date.getHours();//小时
        var minute = date.getMinutes();//分
        var second = date.getSeconds();//秒
        var time = year + "-" + fnW((month + 1)) + "-" + fnW(data) + " " + fnW(hours) + ":" + fnW(minute) + ":" + fnW(second);
        oDiv.innerHTML = time;
    }
    //补位 当某个字段不是两位数时补0
    function fnW(str) {
        var num;
        str > 9 ? num = str : num = "0" + str;
        return num;
    }

    function queryAll() {
        $('#tb_cusha').bootstrapTable('removeAll');
        $.ajax({
                type: "post",
                //url不用说了吧，否则不知道向服务器哪个接口发送并请求
                url: '../MFG/MFGCusha.ashx?Action=getshishijilulist&time=' + $("#time").text(),
                async: true,
                //超时时间
                timeout:30000,
                success: function(data) {
                    console.log($.parseJSON(data).rows);
                    var datajson = $.parseJSON(data).rows;
                    tableData = [];
                    for (var i = 0; i < datajson.length; i++) {
                        tableData.push({
                            //这里也就是data-field的名称，getDate是服务器返回的字段名
                            EquNo: datajson[i].EquNo,
                            Kind: datajson[i].Kind,
                            Chanliangm: datajson[i].Chanliangm,
                            Chanliangkg: datajson[i].Chanliangkg,
                            tongguansudu: datajson[i].tongguansudu,
                            dingyisudu: datajson[i].dingyisudu,
                            luolasudu: datajson[i].luolasudu,
                            shengjiangsudu: datajson[i].shengjiangsudu,
                            tongguanwendu: datajson[i].tongguanwendu,
                            dingyiwendu: datajson[i].dingyiwendu,
                            luolawendu: datajson[i].luolawendu,
                            shengjiangwendu: datajson[i].shengjiangwendu,
                            longjinweizhi: datajson[i].longjinweizhi,
                            dangqianchangdu: datajson[i].dangqianchangdu,
                            dangqianxiaolv: datajson[i].dangqianxiaolv,
                            chesu: datajson[i].dangqianxiaolv,
                            zhuangtai: datajson[i].zhuangtai
                        })
                    }

                    $('#tb_cusha').bootstrapTable('append', tableData);
                }
            });
    }

    function tingcheyuanyinA() {
        var equno = $('#equnolist2').find('option:selected').text();
        var type = "A";
        dialogOpen({
            id: "Form",
            title: '机台-'+ equno + '当日早班停车原因分析',
            url: '../MFG/TingcheyuanyinPie.html?equno=' + equno + '&type='+ type,
            width: "600px",
            height: "600px",
            async: true,
            btn: null
        });
    }

    function tingcheyuanyinB() {
        var equno = $('#equnolist2').find('option:selected').text();
        var type = "B";
        dialogOpen({
            id: "Form",
            title: '机台-' + equno + '当日中班停车原因分析',
            url: '../MFG/TingcheyuanyinPie.html?equno=' + equno + '&type=' + type,
            width: "600px",
            height: "600px",
            async: true,
            btn: null
        });
    }

    function tingcheyuanyinC() {
        var equno = $('#equnolist2').find('option:selected').text();
        var type = "C";
        dialogOpen({
            id: "Form",
            title: '机台-' + equno + '当日晚班停车原因分析',
            url: '../MFG/TingcheyuanyinPie.html?equno=' + equno + '&type=' + type,
            width: "600px",
            height: "600px",
            async: true,
            btn: null
        });
    }

    function alarm(EquNo, AlarmName) {
        //var keyValue = $("#gridTable").jqGridRowValue("EquNo");
        //var AlarmName = $("#gridTable").jqGridRowValue("AlarmName");
        dialogOpen({
            id: "Form",
            title: '报警信息故障排查-' + EquNo,
            url: '../MFG/AlarmPaicha.html?equno=' + EquNo + '&AlarmName=' + AlarmName,
            width: "600px",
            height: "500px",
            btn: null
        });
    }
    </script>

</body>

</html>
